cmake_minimum_required(VERSION 3.15)
project(LSMTree)

set(CMAKE_CXX_STANDARD 11)

aux_source_directory(${PROJECT_SOURCE_DIR}/src SRC_DIR)
aux_source_directory(${PROJECT_SOURCE_DIR}/src/mem MEM_SRC_DIR)
aux_source_directory(${PROJECT_SOURCE_DIR}/src/disk DISK_SRC_DIR)

include_directories(${PROJECT_SOURCE_DIR}/include)

add_executable(skiplist_test ./test/skiplist_test.cc ${MEM_SRC_DIR})
add_executable(sst_test ./test/sst_table_test.cc ${DISK_SRC_DIR} ${MEM_SRC_DIR})
add_executable(level_zero_test ./test/level_zero_test.cc ${DISK_SRC_DIR} ${MEM_SRC_DIR} ${SRC_DIR})
add_executable(level_non_zero_test ./test/level_non_zero_test.cc ${DISK_SRC_DIR} ${MEM_SRC_DIR} ${SRC_DIR})
add_executable(level_one_read_test ./test/level_one_read_test.cc ${DISK_SRC_DIR} ${MEM_SRC_DIR} ${SRC_DIR})
add_executable(level_zero_read_test ./test/level_zero_read_test.cc ${DISK_SRC_DIR} ${MEM_SRC_DIR} ${SRC_DIR})
add_executable(lsmtree_test ./test/lsmtree_test.cc ${DISK_SRC_DIR} ${MEM_SRC_DIR} ${SRC_DIR})

add_library(lsmtree SHARED ${DISK_SRC_DIR} ${MEM_SRC_DIR} ${SRC_DIR})